<%@ page language="java"  pageEncoding="UTF-8"%>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>修改企业</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
  <link rel="stylesheet" href="<%=request.getContextPath() %>/resources/validform/css/demo.css" type="text/css"></link>
  <link rel="stylesheet" href="<%=request.getContextPath() %>/resources/validform/css/style.css" type="text/css"></link>
  <link rel="stylesheet" href="<%=request.getContextPath() %>/resources/admin/css/add.css" type="text/css"></link>
  <script type="text/javascript" src="<%=request.getContextPath() %>/resources/js/jquery-1.9.1.min.js"></script>
 </head>
  
  <body>
  <form  id="myForm" name="myForm"  action="<%=request.getContextPath() %>/company!updateCompany.action" suc_url="<%=request.getContextPath() %>/company!searchCompany.action?page=${request.curPage}" class="myform"  enctype="multipart/form-data">
  	<div id="inside_content">
		<div id="dynamic">你现在所在的位置：企业管理>>新增企业</div>
		<div id="add_content">
			<div id="add_title">
				&nbsp;修改企业
				<ul>
					<li><input type="submit" value="" style="background: url(<%=request.getContextPath() %>/resources/admin/images/add.png) top left no-repeat;"/></li>
					<li><input type="reset" value="" style="background: url(<%=request.getContextPath() %>/resources/admin/images/add_reset.png) top left no-repeat;"/></li>
					<li><input  onclick="back();" type="button" value="" style="background: url(<%=request.getContextPath() %>/resources/admin/images/add_return.png) top left no-repeat;"/></li>
				</ul>
			</div>
			<table id="table_content"  >
				<tr>
		 			<td >名称</td>
		 			<td style="width: 200px;">
		 				<input  id="title" name="title" value="${request.resultMap.info.title }"  type="text"  class="inputxt" datatype="*" nullmsg="请输入名称"   />
		 			</td>
		 			<td class="Validform_checktip"></td>
	 			</tr>
	 		 	<tr>
		 			<td>图片来源</td>
		 			<td>
	 					<select id="imgsource" name="imgsource" >
	 						 <c:forEach var="info" items="${request.tply }">
 					 			<option value="${info.code }"  <c:if test="${info.code==request.resultMap.info.imgsource }"> selected='selected'</c:if>   >${info.value }</option>
 							 </c:forEach>
	 					</select>
		 			</td>
		 			<td>&nbsp;</td>
	 			</tr>
	 			<tr id="tr_img_url" style="display: none;">
		 			<td>图片地址</td>
		 			<td id="td_img_url"></td>
		 			<td class="Validform_checktip"></td>
	 			</tr>
	 			<tr id="tr_img_show">
		 			<td>图片效果</td>
		 			<td id="td_img_show">
		 				<c:if test="${request.resultMap.info.imgsource==1 }"><img src="<%=request.getContextPath() %>${request.resultMap.info.img_url}"  />  </c:if>
		 				<c:if test="${request.resultMap.info.imgsource==2 }"><img src="${request.resultMap.info.img_url}"  />  </c:if>
		 				<input  id="update_img" name="update_img" type="button" value="修改图片" />
		 				<input  id="img_url" name="img_url" type="hidden" value="${request.resultMap.info.img_url}" />
		 			</td>
		 			<td ></td>
	 			</tr>
	 			<tr>
		 			<td>排序</td>
		 			<td>
		 				<input  id="orderid" name="orderid" value="${request.resultMap.info.orderid}"  type="text" class="inputxt"  ignore="ignore" datatype="n" errormsg="请输入数字排序" />
		 			</td>
		 			<td class="Validform_checktip"></td>
	 			</tr>
	 			<tr>
		 			<td>描述</td>
		 			<td ><textarea id="description" name="description"  >${request.resultMap.info.description}</textarea> </td>
		 			<td class="Validform_checktip"></td>
	 			</tr>
	 			<tr>
		 			<td>页面内容</td>
		 			<td colspan="2"><textarea id="htmlContent" name="htmlContent" class="kindeitor" >${request.resultMap.info.htmlContent}</textarea></td>
	 			</tr>
			</table>
			<div class="clear"></div>
		</div>
	</div>
	<input  id="id"  name="id" type="hidden" value="${request.resultMap.info.id}" />
	<input  id="old_img_url"  name="old_img_url" type="hidden" value="${request.resultMap.info.img_url}" />
	<input  id="is_update_img"  name="is_update_img" type="hidden" value="0" />  
</form>
 <script type="text/javascript"  src="<%=request.getContextPath() %>/resources/js/jquery.form.js"></script>
 <script type="text/javascript"  src="<%=request.getContextPath() %>/resources/validform/js/Validform_v5.3.2.js"></script>
 <script type="text/javascript"  src="<%=request.getContextPath() %>/resources/kindeditor/kindeditor.js"></script>
 <script type="text/javascript"  src="<%=request.getContextPath() %>/resources/kindeditor/lang/zh_CN.js"></script>
 <script type="text/javascript"  src="<%=request.getContextPath() %>/resources/kindeditor/plugins/code/prettify.js"></script>
 <script type="text/javascript"  src="<%=request.getContextPath() %>/resources/js/common.js"></script>
 <script type="text/javascript"  src="<%=request.getContextPath() %>/resources/js/opform.js"></script>
 <script type="text/javascript">
 	$("#imgsource").change(function (){
 		 if($(this).val()=="2"){
 		 	$("#td_img_url").html("<input  id='img_url' name='img_url'  type='text' class='inputxt' datatype='*' nullmsg='请输入图片地址'  />");
 		 }else if($(this).val()=="1"){
 		 	$("#td_img_url").html("<input  id='image' name='image'  type='file' class='inputxt' datatype='*' nullmsg='请选择本地图片'  />");
 		 }
 	});
 	
 	$("#update_img").click(function(){
 		$("#imgsource").change();
 		$("#is_update_img").val("1");  //是否修改 图片  1为修改
 		$("#tr_img_url").css("display","block");
 		$("#tr_img_show").remove();
 	});
 </script>
 </body>
</html>
